<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
  <input type="password" v-model="user.password" placeholder="请输入旧密码">
  <input type="password" v-model="user.password1" placeholder="请输入新密码">
    <input type="button" value="修改" @click="pswd()">
</div>
<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script>
    let v = new Vue({
        el:"div",
        data:{
            user:{
                password1:"",
                password:"",
            }
        },
        methods:{
            pswd(){
                axios.post("/pswd",v.user).then(function (response){
                    if (response.data==1){
                        alert("修改成功!")
                        location.href="/";
                        return
                    }
                    alert("您输入的旧密码有误,请重新输入!")
                    v.user.password="";
                    v.user.password1="";
                })
            }
        }
    })
</script>
</body>
</html>